from openpyxl import load_workbook


class write():
    def __init__(self, path, sheetname):
        self.wookbook = load_workbook(path)
        self.sheetname = self.wookbook[sheetname]
        self.path = path

    def write(self, row_index, column_index, data):
        self.sheetname.cell(row = row_index, column=column_index, value=str(data))
        self.wookbook.save(self.path)
